using System;
using System.Collections.Generic;
using System.Text;
using XinBang.Entity;
using XinBang.DAL;

namespace XinBang.BLL
{
    public class TaskBL
    {
        private ITaskDA<Task> td = BusinessLogicFactory.GetSendGoodsTaskDA();

        public void InsertSendGoodsTask(SendGoodsTask sgt)
        {
            if (GetSendGoodsTaskByOrderId(sgt.OrderID.Ordid) == null)
            {
                sgt.BeginTime = DateTime.Now;
                td.Insert(sgt);
            }
        }

        public Task GetSendGoodsTaskByOrderId(int p)
        {
            return td.GetSendGoodsTaskByOrderId(p);
        }


        public IList<Order> GetSendList()
        {
            return td.GetSendList();
        }

        public void UpdateTask(Task task)
        {
            td.Update(task);
        }

        public IList<Order> GetHaveSentOrderList()
        {
            return td.GetHaveSentOrderList();
        }
    }
}
